<?php $role_access = Zend_Registry::get('role_access'); ?>
<!DOCTYPE HTML>
<html>
<head>
<meta name="author" content="<?php echo $this->SITE_NAME; ?>"/>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<script>
    var BASE_PATH = '<?php echo BASE_PATH;?>';
</script>
<title>Master Design</title>
<?php
    #echo $this->headTitle();
    echo $this->headScript();
    echo $this->headLink();
?>
</head>
<body>
    <div id="ncleangrey-container">
	<!--Navigation Starts -->
	<a href="<?php echo $this->BASE_URL; ?>" style="float:left">
	    <img src="<?php echo $this->IMAGE_PATH; ?>layout/logo.png" height ="70px" alt="<?php echo $this->SITE_NAME; ?> Admin Site" title="<?php echo $this->SITE_NAME; ?> Admin Site" />
	</a><br/><br/>
	<div id="logocontainer">
	    <div class="logotext">
		<?php echo $this->SITE_NAME;
		; ?>&trade; <?php echo ucfirst(strtolower($this->user->role)); ?> Console
		<br />
                Welcome: 
                <a style="text-decoration: underline;" href="<?php echo $this->url(array('controller' => strtolower($this->user->role), 'action' => 'profile'), null, TRUE); ?>" >
		<?php echo $this->user->name; ?>
                </a>
	    </div>
	</div>
        <a href="#nogo" class="MenuLinksBtn" id="MenuLinksBtn">Navigation</a>
	<div class="topmenucontainer"  id="access">
	    <ul id="nav">
		<li>
		    <a href="<?php echo $this->url(array('controller' => 'index', 'action' => 'index'), null, TRUE); ?>" <?php if($this->CONTROLLER_NAME == 'index'):  ?>class="selected"<?php endif; ?> >Dashboard</a>
		</li>
                <?php if (array_key_exists('customer', $role_access)): ?>
		<li>
                    <a href="<?php echo $this->url(array('controller' => 'customer', 'action' => 'list'), null, TRUE); ?>" <?php if($this->CONTROLLER_NAME == 'customer'):  ?>class="selected"<?php endif; ?> >Customer</a>
                    <ul>
                        
                        <?php if (array_key_exists('form', $role_access['customer'])): ?>
                         <li><a href="<?php echo $this->url(array('controller' => 'customer', 'action' => 'form'), null, TRUE); ?>">Add Customer</a></li>
                         <?php endif;?>

                         <?php if (array_key_exists('list', $role_access['customer'])): ?>
                         <li><a href="<?php echo $this->url(array('controller' => 'customer', 'action' => 'list'), null, TRUE); ?>">Customer Listing</a></li>
                         <?php endif;?>
                         
                         <?php if (array_key_exists('form', $role_access['customer'])): ?>
                        <li><a href="<?php echo $this->url(array('controller' => 'customer', 'action' => 'project'), null, TRUE); ?>">Project Listing</a></li>
                        <?php endif;?>
                         
                    </ul>
		</li>
                <?php endif;?>
		
                <?php if (array_key_exists('contractor', $role_access)): ?>
                <li>
                <a href="<?php echo $this->url(array('controller' => 'contractor', 'action' => 'list'), null, TRUE); ?>" <?php if($this->CONTROLLER_NAME == 'contractor'):  ?>class="selected"<?php endif; ?> >Contractor</a>
                <ul>
                    
                    <?php if (array_key_exists('form', $role_access['contractor'])): ?>
                     <li><a href="<?php echo $this->url(array('controller' => 'contractor', 'action' => 'form'), null, TRUE); ?>">Add Contractor</a></li>
                     <?php endif;?>

                     <?php if (array_key_exists('list', $role_access['contractor'])): ?>
                     <li><a href="<?php echo $this->url(array('controller' => 'contractor', 'action' => 'list'), null, TRUE); ?>">Contractor Listing</a></li>
                     <?php endif;?>
                     
                     <?php if (array_key_exists('form', $role_access['contractor'])): ?>
                     <li><a href="<?php echo $this->url(array('controller' => 'contractor', 'action' => 'project'), null, TRUE); ?>">Project Listing</a></li>
                     <?php endif;?>
                     
                </ul>
		</li>
                <?php endif;?>
                
                <?php if (array_key_exists('designer', $role_access)): ?>
                <li>
                <a href="<?php echo $this->url(array('controller' => 'designer', 'action' => 'list'), null, TRUE); ?>" <?php if($this->CONTROLLER_NAME == 'designer'):  ?>class="selected"<?php endif; ?> >Designer</a>
               <ul>

                    <?php if (array_key_exists('form', $role_access['designer'])): ?>
                    <li><a href="<?php echo $this->url(array('controller' => 'designer', 'action' => 'form'), null, TRUE); ?>">Add Designer</a></li>
                    <?php endif;?>

                    <?php if (array_key_exists('list', $role_access['designer'])): ?>
                    <li><a href="<?php echo $this->url(array('controller' => 'designer', 'action' => 'list'), null, TRUE); ?>">Designer Listing</a></li>
                    <?php endif;?>
               </ul>
		</li>
                <?php endif;?>
                
                
                <?php if (array_key_exists('product', $role_access)): ?>
                <li>
                <a href="<?php echo $this->url(array('controller' => 'product', 'action' => 'list'), null, TRUE); ?>" <?php if($this->CONTROLLER_NAME == 'product'):  ?>class="selected"<?php endif; ?> >Product</a>
               <ul>

                    <?php if (array_key_exists('form', $role_access['product'])): ?>
                    <li><a href="<?php echo $this->url(array('controller' => 'product', 'action' => 'form'), null, TRUE); ?>">Add Product</a></li>
                    <?php endif;?>

                    <?php if (array_key_exists('list', $role_access['product'])): ?>
                    <li><a href="<?php echo $this->url(array('controller' => 'product', 'action' => 'list'), null, TRUE); ?>">Product Listing</a></li>
                    <?php endif;?>

               </ul>
		</li>
                <?php endif;?>
                
                <?php if (array_key_exists('job', $role_access)): ?>
                <li>
                <a href="<?php echo $this->url(array('controller' => 'job', 'action' => 'list'), null, TRUE); ?>" <?php if($this->CONTROLLER_NAME == 'job'):  ?>class="selected"<?php endif; ?> >Job</a>
               <ul>
                   <?php if (array_key_exists('form', $role_access['job'])): ?>
                    <li><a href="<?php echo $this->url(array('controller' => 'job', 'action' => 'form'), null, TRUE); ?>">Add Job</a></li>
                    <?php endif;?>

                    <?php if (array_key_exists('list', $role_access['job'])): ?>
                    <li><a href="<?php echo $this->url(array('controller' => 'job', 'action' => 'list'), null, TRUE); ?>">Job Listing</a></li>
                    <?php endif;?>
                    
               </ul>
		</li>
                <?php endif;?>
                
                <?php if (array_key_exists('calculator', $role_access)): ?>
                <li>
                <a href="<?php echo $this->url(array('controller' => 'calculator', 'action' => 'index'), null, TRUE); ?>" <?php if($this->CONTROLLER_NAME == 'calculator'):  ?>class="selected"<?php endif; ?> >Calculator</a>
		</li>
                <?php endif;?>
                
                <?php if (array_key_exists('quotation', $role_access)): ?>
                <li>
                <a href="<?php echo $this->url(array('controller' => 'quotation', 'action' => 'list'), null, TRUE); ?>" <?php if($this->CONTROLLER_NAME == 'quotation'):  ?>class="selected"<?php endif; ?> >Quotation</a>
                <ul>

                    <?php if (array_key_exists('form', $role_access['quotation'])): ?>
                     <li><a href="<?php echo $this->url(array('controller' => 'quotation', 'action' => 'form'), null, TRUE); ?>">Add Quotation</a></li>
                     <?php endif;?>

                     <?php if (array_key_exists('list', $role_access['quotation'])): ?>
                     <li><a href="<?php echo $this->url(array('controller' => 'quotation', 'action' => 'list'), null, TRUE); ?>">Quotation Listing</a></li>
                     <?php endif;?>
                     
                </ul>
		</li>
                <?php endif;?>
                
                <?php if (array_key_exists('project', $role_access)): ?>
                <li>
                    <a href="<?php echo $this->url(array('controller' => 'project', 'action' => 'list'), null, TRUE); ?>" <?php if ($this->CONTROLLER_NAME == 'project'): ?>class="selected"<?php endif; ?> >Project</a>
                    <ul>
                        <?php if (array_key_exists('form', $role_access['project'])): ?>
                        <li><a href="<?php echo $this->url(array('controller' => 'project', 'action' => 'form'), null, TRUE); ?>">Add Project</a></li>
                        <?php endif;?>

                        <?php if (array_key_exists('list', $role_access['project'])): ?>
                        <li><a href="<?php echo $this->url(array('controller' => 'project', 'action' => 'list'), null, TRUE); ?>">Project Listing</a></li>
                        <?php endif;?>
                    </ul>
                </li>
                <?php endif;?>
                
                
                <?php if (array_key_exists('category', $role_access)): ?>
                <li>
                    <a href="<?php echo $this->url(array('controller' => 'category', 'action' => 'list'), null, TRUE); ?>" <?php if ($this->CONTROLLER_NAME == 'category'): ?>class="selected"<?php endif; ?> >Category</a>
                    <ul>
                        <?php if (array_key_exists('form', $role_access['category'])): ?>
                        <li><a href="<?php echo $this->url(array('controller' => 'category', 'action' => 'form'), null, TRUE); ?>">Add Category</a></li>
                        <?php endif;?>

                        <?php if (array_key_exists('list', $role_access['category'])): ?>
                        <li><a href="<?php echo $this->url(array('controller' => 'category', 'action' => 'list'), null, TRUE); ?>">Category Listing</a></li>
                        <?php endif;?>
                    </ul>
                </li>
                <?php endif;?>
                
                
                <?php /*if (array_key_exists('contractor', $role_access)): ?>
                <li>
                    <a href="<?php echo $this->url(array('controller' => strtolower($this->user->role), 'action' => 'profile'), null, TRUE); ?>" <?php if($this->CONTROLLER_NAME == strtolower($this->user->role) && $this->ACTION_NAME == 'profile' ):  ?>class="selected"<?php endif; ?> >Site Preferences</a>
                    <ul>
                        <li><a href="<?php echo $this->url(array('controller' => strtolower($this->user->role), 'action' => 'profile'), null, TRUE); ?>">Edit Profile</a></li>
                    </ul>
                </li>
                <?php endif; */?>
                
		<li>
		    <a href="<?php echo $this->url(array('controller' => 'logout', 'action' => 'index'), null, TRUE); ?>" <?php if($this->CONTROLLER_NAME == 'logout'):  ?>class="selected"<?php endif; ?> >Log Out</a>
		</li>
                
	    </ul>
	    <div class="clearb"></div>
	</div>
	<!--Navigation Ends-->
	<div class="breadcrumbs">
            <div id="nav-icons_all" class="display-none">
                <ul id="nav-icons">
                    <li class="logout-icon"><a  title="Logout"  href="<?php echo $this->url(array('controller' => 'logout', 'action' => 'index'), null, TRUE); ?>">Logout</a></li>
                </ul>
            </div>
	    <?php if(isset($this->breadcrumbs)):?>
		<?php echo GTL_Common::initializeBreadCrumbs($this->breadcrumbs);?>
	    <?php endif;?>
        </div>
        <div class="hstippled">&nbsp;</div>
    
    <?php echo $this->layout()->content ?>
<div id="footer">
    <div id="copy"> &copy;
	<a rel="external" href="<?php echo $this->BASE_URL; ?>">
	    <?php echo $this->SITE_NAME; ?>
	</a>
	&trade;
    </div>
</div><!--end footer-->
</div>
</body>
</html>